﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CalculatorLogic
{
    public struct GraphSetting
    {
        #region fields
        /// <summary>
        /// the minimal xAxis Value for the graph
        /// </summary>
        double xMin;
        /// <summary>
        /// the maximal xAxis Value for the graph
        /// </summary>
        double xMax;
        /// <summary>
        /// The x axis scale interval for Graph.GraphIntervals
        /// </summary>
        double xScale;
        /// <summary>
        /// the minimal yAxis value for the graph
        /// </summary>
        double yMin;
        /// <summary>
        /// the maximal yAxis value for the graph
        /// </summary>
        double yMax;
        /// <summary>
        /// the y axis scale interval 
        /// </summary>
        double yScale;

        /// <summary>
        /// default GraphSettings readonly
        /// </summary>
        private static GraphSetting defaultGraphSettings;
        
        #endregion fields

        #region Constructors
        /// <summary>
        /// Graph Setting with custom specified settings
        /// </summary>
        /// <param name="xMin">the minimal x value setting</param>
        /// <param name="xMax">the maximal x value setting</param>
        /// <param name="xScale">the scale of the x axis</param>
        /// <param name="yMin">the minimal y value setting</param>
        /// <param name="yMax">the maximal y value setting</param>
        /// <param name="yScale">the scale of the y axis</param>
        public GraphSetting(double xMin, double xMax, double xScale, double yMin, double yMax, double yScale)
        {
            this.xMin = xMin;
            this.xMax = xMax;
            this.yMin = yMin;
            this.yMax = yMax;
            this.xScale = xScale;
            this.yScale = yScale;
        }
       
        #endregion Constructors

        #region Properties

        /// <summary>
        /// Get Default GraphSettings to initialize a blank graph
        /// </summary>
        public static GraphSetting DefaultGraphSettings
        {
            get 
            {
                defaultGraphSettings
                    = new GraphSetting(-10.0d,
                                        10.0d,
                                        1.0d,
                                        -10.0d,
                                        10.0d,
                                        1.0d);
                return defaultGraphSettings;
            }
        }

        /// <summary>
        /// Get or set the XMin value setting
        /// </summary>
        public double XMin
        {
            get { return xMin; }
            set { xMin = value; }
        }

        /// <summary>
        /// Get or set the XMax value setting
        /// </summary>
        public double XMax
        {
            get { return xMax; }
            set { xMax = value; }
        }

        /// <summary>
        /// Get or set the YMin value setting
        /// </summary>
        public double YMin
        {
            get { return yMin; }
            set { yMin = value; }
        }

        /// <summary>
        /// Get or set the YMax value setting
        /// </summary>
        public double YMax
        {
            get { return yMax; }
            set { yMax = value; }
        }

        /// <summary>
        /// Get or set the XScale value setting
        /// </summary>
        public double XScale
        {
            get { return xScale; }
            set { xScale = value; }
        }

        /// <summary>
        /// Get or set the YScale value setting
        /// </summary>
        public double YScale
        {
            get { return yScale; }
            set { yScale = value; }
        }
       
        #endregion Properties

    }
}
